//
//  QuickQueryViewController.m
//  Audit
//
//  Created by cc on 15-2-28.
//  Copyright (c) 2015年 cc. All rights reserved.
//

#import "QuickQueryViewController.h"
#import "GetVinViewController.h"
#import "Car.h"

@interface QuickQueryViewController ()

@end

@implementation QuickQueryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(IBAction)scanAction:(id)sender
{
    //扫描输入
    if ([self.delegate respondsToSelector:@selector(scanAction:)]) {
        
        [self.delegate scanAction:textFieldVIN.text];
    }
    
    
}


-(IBAction)queryAction:(id)sender
{
    //查询
    if ([self.delegate respondsToSelector:@selector(beginQueryByCondition:)]) {
        
        Car *condition=[[Car alloc] init];
        
        condition.vin   = textFieldVIN.text;
        condition.model = textFieldModel.text;
        condition.csn   = textFieldCsn.text;
        
        [self.delegate beginQueryByCondition:condition];//todo传入查询条件
    }
}

-(IBAction)advancedQueryAction:(id)sender
{
    //高级查询
    if ([self.delegate respondsToSelector:@selector(quickQueryAdvancedQuery)]) {
        [self.delegate quickQueryAdvancedQuery];
    }
    
}
@end
